package cn.yuemouren.security.browser.session;

import org.springframework.security.web.session.SessionInformationExpiredEvent;
import org.springframework.security.web.session.SessionInformationExpiredStrategy;

import javax.servlet.ServletException;
import java.io.IOException;

/**
 * @Author: Timi
 * @Description: 自定义实现session过期策略类
 * @Date: 2020/6/28 14:16
 * @Version: v1.0
 */
public class TimiExpiredSessionStrategy extends AbstractSessionStrategy implements SessionInformationExpiredStrategy {
    public TimiExpiredSessionStrategy(String invalidSessionUrl) {
        super(invalidSessionUrl);
    }

    @Override
    public void onExpiredSessionDetected(SessionInformationExpiredEvent eventØ) throws IOException, ServletException {
        onSessionInvalid(eventØ.getRequest(),eventØ.getResponse());
    }

    @Override
    protected boolean isConcurrency() {
        return true;
    }
}
